package top.ranzhang.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import top.ranzhang.bean.entity.ParentCommunications;
import top.ranzhang.mapper.ParentCommunicationsMapper;
import top.ranzhang.service.IParentCommunicationsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ran
 * @since 2025-06-05
 */
@Service
public class ParentCommunicationsServiceImpl extends ServiceImpl<ParentCommunicationsMapper, ParentCommunications> implements IParentCommunicationsService {

    @Autowired
    private ParentCommunicationsMapper parentCommunicationsMapper;

    @Override
    public ParentCommunications getById(Long id) {
        return parentCommunicationsMapper.selectById(id);
    }

    @Override
    public List<ParentCommunications> getAll() {
        return parentCommunicationsMapper.selectAll();
    }

    @Override
    public void MSave(ParentCommunications communication) {
        parentCommunicationsMapper.insert(communication);
    }

    @Override
    public void update(ParentCommunications communication) {
        parentCommunicationsMapper.update(communication);
    }

    @Override
    public void delete(Long id) {
        parentCommunicationsMapper.delete(id);
    }

    @Override
    public Integer getCommunicationCount() {
        return parentCommunicationsMapper.getCommunicationCount();
    }


}
